Skip to content

Conversation

@avik-pal
Copy link
Collaborator

fixes #1892

@avik-pal avik-pal force-pushed the ap/better_lowering branch 2 times, most recently from e3f1bc0 to 52df7a9 Compare November 21, 2025 22:28
@avik-pal
Copy link
Collaborator Author

somehow this change breaks 1.11 interpreter

@avik-pal
Copy link
Collaborator Author

@wsmoses any idea why the stackoverflow happens here?

https://github.com/EnzymeAD/Reactant.jl/actions/runs/19586536457/job/56096622229?pr=1896#step:20:25830

ERROR: LoadError: StackOverflowError:
Stacktrace:
    [1] abstract_call_known(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, f::Any, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
      @ Enzyme.Compiler.Interpreter ~/.julia/packages/Enzyme/sSbWV/src/compiler/interpreter.jl:1047
    [2] abstract_call(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState, max_methods::Int64)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2282
    [3] abstract_call(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, arginfo::Core.Compiler.ArgInfo, si::Core.Compiler.StmtInfo, sv::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2275
    [4] abstract_call(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2423
    [5] abstract_eval_call(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2438
    [6] abstract_eval_statement_expr(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, e::Expr, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2454
    [7] abstract_eval_statement(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, e::Any, vtypes::Vector{Core.Compiler.VarState}, sv::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:2752
    [8] abstract_eval_basic_statement(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, stmt::Any, pc_vartable::Vector{Core.Compiler.VarState}, frame::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:3068
    [9] typeinf_local(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, frame::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:3331
   [10] typeinf_nocycle(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, frame::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/abstractinterpretation.jl:3413
   [11] _typeinf(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, frame::Core.Compiler.InferenceState)
      @ Core.Compiler ./compiler/typeinfer.jl:244
   [12] typeinf(interp::Enzyme.Compiler.Interpreter.EnzymeInterpreter{typeof(Reactant.set_reactant_abi)}, frame::Core.Compiler.InferenceState)

@wsmoses
Copy link
Member

wsmoses commented Nov 22, 2025

so inference is recurring, so somewhere there's an accidental interpreter infinite recursion. I'd try to add a good deal of inference barriers and see whats up?

or alternatively you can add prints inside the itnerpreter to see what's being caught on

@wsmoses
Copy link
Member

wsmoses commented Dec 11, 2025

yeah no idea

@avik-pal avik-pal force-pushed the ap/better_lowering branch 4 times, most recently from 0bd62f6 to 67b883b Compare December 22, 2025 22:00
@avik-pal avik-pal merged commit 4a7dabc into main Dec 23, 2025
69 of 70 checks passed
@avik-pal avik-pal deleted the ap/better_lowering branch December 23, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve compile times for sum(Slices) (/mapreduce)

3 participants